Skip to content

DOCSP-51350: Vector search queries #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 17, 2025

Conversation

norareidy
Copy link
Collaborator

@norareidy norareidy commented Jul 16, 2025

Pull Request Info

PR Reviewing Guidelines

JIRA - https://jira.mongodb.org/browse/DOCSP-51350

Staging Links

  • atlas-vector-search
  • Self-Review Checklist

    • Is this free of any warnings or errors in the RST?
    • Did you run a spell-check?
    • Did you run a grammar-check?
    • Are all the links working?
    • Are the facets and meta keywords accurate?
    • Are the page titles greater than 20 characters long and SEO relevant?

    @norareidy norareidy requested a review from a team as a code owner July 16, 2025 21:58
    @norareidy norareidy requested review from NathanQingyangXu and removed request for a team July 16, 2025 21:58
    Copy link

    netlify bot commented Jul 16, 2025

    Deploy Preview for docs-kotlin-sync ready!

    Name Link
    🔨 Latest commit 1d16cea
    🔍 Latest deploy log https://app.netlify.com/projects/docs-kotlin-sync/deploys/687907a9947e2d0008316d22
    😎 Deploy Preview https://deploy-preview-117--docs-kotlin-sync.netlify.app
    📱 Preview on mobile
    Toggle QR Code...

    QR Code

    Use your smartphone camera to open QR code link.

    To edit notification comments on pull requests, go to your Netlify project configuration.

    @docs-builder-bot
    Copy link

    docs-builder-bot commented Jul 16, 2025

    🔄 Deploy Preview for docs-kotlin-sync processing

    Item Details
    🔨 Latest Commit 298c48293e4b7200339613bec2f71b02d436e301
    😎 Deploy Preview https://deploy-preview-117--docs-kotlin-sync.netlify.app
    🔍 Build Logs View Logs

    :atlas:`Atlas Vector Search </atlas-vector-search/vector-search-overview/>`
    queries. The ``Aggregates`` builders class provides the
    the ``vectorSearch()`` helper method, which you can use to

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    the ``vectorSearch()`` helper method, which you can use to
    ``vectorSearch()`` helper method, which you can use to

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Oops thank you

    // Specifies the path of the field to search
    val fieldSearchPath: FieldSearchPath = fieldPath("plot_embedding")

    // Creates the vector search pipeline stage with numCandidates and limit

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    given limit is used prior to numCandidates, it might be better to switch the order of them

    val results = collection.aggregate(pipeline)

    results.forEach { doc ->
    val score = doc.getDouble("vectorSearchScore")

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    do we really need the above statement? I assume vectorSearchScore is a meta field name, but not the field name, so I guess doc.getDouble("vectorSearchScore") will return null invariably?

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    No not necessary, I meant to take that line out - fixed!

    Copy link

    @NathanQingyangXu NathanQingyangXu left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    LGTM

    Copy link
    Collaborator

    @rachel-mack rachel-mack left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    LGTM

    @norareidy norareidy merged commit c8b17c1 into mongodb:comp-cov Jul 17, 2025
    6 checks passed
    @norareidy norareidy deleted the DOCSP-51350-avs branch July 17, 2025 20:15
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    4 participants